package com.example.finalwork2.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.example.finalwork2.dto.WarningInfo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

@Data
@TableName("vehicle_signal")
public class VehicleSignal {

    @JsonIgnore
    @TableId(type = IdType.AUTO)
    private Long id;

    private String vehicleId;

    private String batteryType;

    @JsonProperty("Mx")
    private Double Mx;

    @JsonProperty("Mi")
    private Double Mi;

    @JsonProperty("Ix")
    private Double Ix;

    @JsonProperty("Ii")
    private Double Ii;


    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime reportTime;


    @JsonIgnore
    @TableField(exist = false)
    private List<WarningInfo> warnings = new ArrayList<>();

    @JsonIgnore
    @TableField(exist = false)
    private boolean category;


}
